home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 September / EnigmA AMIGA RUN 30 (1998)(G.R. Edizioni)(IT)[!][issue 1998-09].iso / recent / nc-11u1.lha / nc-1.1 / scripts / bsh < prev    next >
Text File  |  1998-07-15  |  487b  |  30 lines

  1. #! /bin/sh
  2. ## a little wrapper to "password" and re-launch a shell-listener.
  3. ## Arg is taken as the port to listen on.  Define "NC" to point wherever.
  4.  
  5. NC=nc
  6.  
  7. case "$1" in
  8.   ?* )
  9.   LPN="$1"
  10.   export LPN
  11.   sleep 1
  12.   echo "-l -p $LPN -e $0" | $NC > /dev/null 2>&1 &
  13.   echo "launched on port $LPN"
  14.   exit 0
  15.   ;;
  16. esac
  17.  
  18. # here we play inetd
  19. echo "-l -p $LPN -e $0" | $NC > /dev/null 2>&1 &
  20.  
  21. while read qq ; do
  22. case "$qq" in
  23. # here's yer password
  24.   gimme )
  25.   cd /
  26.   exec csh -i
  27.   ;;
  28. esac
  29. done
  30.